using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class sport_simple_answer_sheetMap : EntityTypeConfiguration<sport_simple_answer_sheet>
    {
        public sport_simple_answer_sheetMap()
        {
            // Primary Key
            this.HasKey(t => t.sport_simple_answer_sheet_id);

            // Properties
            // Table & Column Mappings
            this.ToTable("sport_simple_answer_sheet");
            this.Property(t => t.sport_simple_answer_sheet_id).HasColumnName("sport_simple_answer_sheet_id");
            this.Property(t => t.visit_date).HasColumnName("visit_date");
            this.Property(t => t.sport_days).HasColumnName("sport_days");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");

            // Relationships
            this.HasOptional(t => t.follow_up)
                .WithMany(t => t.sport_simple_answer_sheet)
                .HasForeignKey(d => d.follow_up_id);

        }
    }
}
